#include "indexframeworksessionservice.h"
#include "connection.h"

IndexFrameworkSessionService::IndexFrameworkSessionService(Connection *conn, QObject *parent)
    : QObject{parent}, m_connection(conn)
{
    connect(m_connection, &Connection::messageReceived, this, &IndexFrameworkSessionService::messageReceived);
}

void IndexFrameworkSessionService::sendMessage(const QByteArray &buffer)
{
    if (!qgetenv("debug").isEmpty()) {
        qDebug() << "client call send msg" << buffer;
    }
    m_connection->writeMessage(buffer);
}
